import org.hyperledger.fabric.sdk.Orderer;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xuguangyuansh on 2018/8/23.
 */
public class Orderers {

    /** orderer 排序服务器根域名 */
    private String ordererDomainName;

    /** orderer 排序服务器集合 */
    private List<Orderer> orderers = orderers = new ArrayList<>();

    public Orderers() { }

    public Orderers(String ordererDomainName) {
        this.ordererDomainName = ordererDomainName;
    }

    public String getOrdererDomainName() {
        return ordererDomainName;
    }

    public void setOrdererDomainName(String ordererDomainName) {
        this.ordererDomainName = ordererDomainName;
    }

    /** 新增排序服务器 */
    public void addOrderer(String name, String location) {
        orderers.add(new Orderer(name, location));
    }

    /** 获取排序服务器集合 */
    public List<Orderer> get() {
        return orderers;
    }

    /**
     * 排序服务器对象
     *
     * @auth xuguangyuansh
     *
     * @date 2018-08-23
     * @email xxx@126.com
     */
    public class Orderer {

        /** orderer 排序服务器的域名 */
        private String ordererName;

        /** orderer 排序服务器的访问地址 */
        private String ordererLocation;

        public Orderer(String ordererName, String ordererLocation) {
            super();
            this.ordererName = ordererName;
            this.ordererLocation = ordererLocation;
        }

        public String getOrdererName() {
            return ordererName;
        }

        public void setOrdererName(String ordererName) {
            this.ordererName = ordererName;
        }

        public String getOrdererLocation() {
            return ordererLocation;
        }

        public void setOrdererLocation(String ordererLocation) {
            this.ordererLocation = ordererLocation;
        }
    }
}
